#ifndef TPE_H
#define TPE_H

#include <cstdint>
#include <string>

typedef int8_t Reg_t;
typedef int8_t Trit_t;
typedef int64_t Tryte_t;

#define TRITS_PER_TRYTE 27

enum {FLAG_OVERFLOW, FLAG_SIGN};

enum {OP_HALT,
      OP_NOP,
      OP_SET_I, OP_SET_R,
      OP_READ_I, OP_READ_R, OP_WRITE_I, OP_WRITE_R,
      OP_NOT, OP_AND_I, OP_AND_R, OP_OR_I, OP_OR_R, OP_XOR_I, OP_XOR_R,
      OP_SHL_I, OP_SHL_R, OP_SHR_I, OP_SHR_R,
      OP_SHLC_I, OP_SHLC_R, OP_SHRC_I, OP_SHRC_R,
      OP_INC, OP_INC3, OP_DEC, OP_DEC3,
      OP_ADD_I, OP_ADD_R, OP_SUB_I, OP_SUB_R, OP_CMP_I, OP_CMP_R,
      OP_ADDC_I, OP_ADDC_R, OP_SUBC_I, OP_SUBC_R,
      OP_SON, OP_SOZ, OP_SOP, OP_SSN, OP_SSZ, OP_SSP,
      OP_JMP,
      OP_JON, OP_JOZ, OP_JOP, OP_JONN, OP_JONZ, OP_JONP,
      OP_JSN, OP_JSZ, OP_JSP, OP_JSNN, OP_JSNZ, OP_JSNP};

#define N_REGS 9

enum {REG_A, REG_B, REG_C, REG_D, REG_E, REG_FLAGS, REG_FRAME, REG_INSTR, REG_STACK};

const std::string regNames[] = {"a", "b", "c", "d", "e", "flags", "frame", "instr", "stack"};

#endif

